#include <iostream>
#include <string>
#include <regex>

int main()
{
    std::string str = "/numbers/1234";//需要提取数字字符串
    //匹配以/number/起始，后边跟了一个或多个数字字符的字符串，并且在匹配过程中提取这个匹配到的数字字符串
    std::regex e("/numbers/(\\d+)");
    std::smatch matches;

    bool ret = std::regex_match(str,matches,e);
    if(ret == false)
    {
        std::cout << "匹配失败" << std::endl;
    }

    for(auto s : matches)
    {
        std::cout << s << std::endl;
    }
    return 0;
}